﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_webcon_category : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.lbDel.Attributes.Add("onclick", "return confirm('确定删除该类型？')");
        }
    }

    public int Guid
    {
        set
        {
            Category c = new Category(value);
            this.hlName.Attributes.Add("Guid", value.ToString());
            this.hlName.NavigateUrl = Params.AdminFolderHttp + "category.aspx?guid=" + value.ToString();
            this.hlName.Text = c.Name;
            this.labDoctorNum.Text = c.DoctorNum.ToString();
            this.labExpertNum.Text = c.ExpertNum.ToString();
            this.labPaperNum.Text = c.PaperNum.ToString();
            this.labStudentNum.Text = c.StudentNum.ToString();
            this.labIntro.Text = c.Intro;
        }
        get
        {
            return Convert.ToInt32(this.hlName.Attributes["Guid"]);
        }
    }

    public int SortID
    {
        set
        {
            this.labSortID.Text = value.ToString();
        }
    }
    protected void lbDel_Click(object sender, EventArgs e)
    {
        Category.Delete(this.Guid);
        Fun.Refresh("删除成功");
    }
}
